﻿using System;
using System.Collections;
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;

namespace GriffinNav.UI
{
    public class MapControls
    {
        private MapControl mZoomIn;
        private MapControl mZoomOut;

        public MapControls(Rectangle screenRectangle)
        {
            Bitmap zoomInUp = new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("GriffinNav.Images.ZoomIn.gif"));
            Bitmap zoomInDown = new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("GriffinNav.Images.ZoomInDown.gif"));

            mZoomIn = new MapControl(
                zoomInUp,
                zoomInDown,
                new Rectangle(screenRectangle.X + 8, screenRectangle.Y + 8, zoomInUp.Width, zoomInUp.Height));

            Bitmap zoomOutUp = new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("GriffinNav.Images.ZoomOut.gif"));
            Bitmap zoomOutDown = new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("GriffinNav.Images.ZoomOutDown.gif"));

            mZoomOut = new MapControl(
                zoomOutUp,
                zoomOutDown,
                new Rectangle(screenRectangle.X + 8, screenRectangle.Bottom - zoomOutUp.Height - 8, zoomOutUp.Width, zoomOutUp.Height));
        }

        public Rectangle ScreenRectangle
        {
            set
            {
                mZoomIn.ScreenPosition = new Rectangle(value.X + 8, value.Y + 8, mZoomIn.Image.Width, mZoomIn.Image.Height);
                mZoomOut.ScreenPosition = new Rectangle(value.X + 8, value.Bottom - mZoomOut.Image.Height - 8, mZoomOut.Image.Width, mZoomOut.Image.Height);
            }
        }

        public MapControl ZoomIn
        {
            get
            {
                return mZoomIn;
            }
        }

        public MapControl ZoomOut
        {
            get
            {
                return mZoomOut;
            }
        }
    }
}
